FROMGIT: ASoC: use dma_ops of parent device for acp_audio_dma AMD platform device acp_audio_dma can only be created by parent PCI device driver (drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c). Pass struct device of the parent to snd_pcm_lib_preallocate_pages() so dma_alloc_coherent() can use correct dma_ops. Otherwise, it will use default dma_ops which is nommu_dma_ops on x86_64 even when IOMMU is enabled and set to non passthrough mode. Though platform device inherits some dma related fields during its creation in mfd_add_device(), we can't simply pass its struct device to snd_pcm_lib_preallocate_pages() because dma_ops is not among the inherited fields. Even it were, drivers/iommu/amd_iommu.c would ignore it because get_device_id() doesn't handle platform device. This change shouldn't give us any trouble even struct device of the parent becomes null or represents some non PCI device in the future, because get_dma_ops() correctly handles null struct device or uses the default dma_ops if struct device doesn't have it set. Signed-off-by: Yu Zhao <yuzhao@google.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 23aa128bb28d9da69bb1bdb2b70e50128857884a git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next) BUG=b:74746196,b:112880090,b:117648023,b:117655204,b:117682788,b:117872985,b:118762519,b:119068670 TEST=suspend_stress_test Change-Id: Id56dee4385304827f1e37ee32f2ae7d7cfb9aa64 Reviewed-on: https://chromium-review.googlesource.com/1360375 Commit-Ready: Yu Zhao <yuzhao@chromium.org> Tested-by: Yu Zhao <yuzhao@chromium.org> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1415191 Reviewed-by: Yu Zhao <yuzhao@chromium.org> Commit-Queue: Yu Zhao <yuzhao@chromium.org> Trybot-Ready: Yu Zhao <yuzhao@chromium.org> 
1 file changed